﻿@model Microsoft.AspNet.Identity.EntityFramework.IdentityUser

@{
    ViewBag.Title = "Details";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Details</h2>

<div>
    <h4>MyIdentityUser</h4>
    <hr />
            <dl class="dl-horizontal">
                <dt>
                    @Html.DisplayNameFor(model => model.UserName)
                </dt>

                <dd>
                    @Html.DisplayFor(model => model.UserName)
                </dd>

                <dt>
                    Roles
                </dt>

                @foreach (Microsoft.AspNet.Identity.EntityFramework.IdentityUserRole role in Model.Roles)
                {
                    <dd>
                        @Html.DisplayFor(x => role.Role.Name)
                    </dd>
                    
                    <dd>
                        @Html.ActionLink("Delete", "RemoveRole", new { userId=role.UserId, roleName=role.Role.Name })
                    </dd>
                }
            </dl>
        </div>

<p>
    @Html.ActionLink("Edit", "Edit", new { id = Model.Id }) |
    @Html.ActionLink("Back to List", "Index")
</p>

@Html.Action("IndexRoles", "User", new { userId = Model.Id })


